package com.atguigu.gmall.item.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.item.service.SkuDetailService;
import com.atguigu.gmall.model.to.SkuDetailTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/rpc/inner/item")
@RestController
public class SkuItemDetailRpcController {
    @Autowired
    SkuDetailService skuDetailService;

    //查询商品详情......./////
    @GetMapping("/sku/detail/{skuId}")
    public Result<SkuDetailTo> getSkuItemDetail(@PathVariable("skuId") Long skuId){

        SkuDetailTo skuDetailTo =skuDetailService.getSkuItemDetail(skuId);


        return Result.ok(skuDetailTo);
    }
}
